<?php


namespace app\api\controller\v1;

//权限控制
use app\api\service\Pay as PayService;
use app\api\service\WxNotify;
use app\api\validate\IDMustBePostiveInt;

class Pay extends BaseController
{
    //前置操作
    protected $beforeActionList = [
        'checkExclusiveScope' => ['onely' => 'placeOrder']
    ];

    public function getPreOrder($id = '')
    {
        (new IDMustBePostiveInt())->goCheck();
        $pay = new PayService($id);
        return $pay->pay();
    }

    public function reciveNotify()
    {
        $notify = new WxNotify();
        $notify->Handle();
    }
}